/**
 * @author JackGao
 *			email:jackgao.china@gmail.com
 *  date：2016-6-23
 *  qqqqq
 * 
 */
package cn.cuit.ds.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.springframework.stereotype.Repository;

import cn.cuit.ds.dao.IGoods2OrdersDao;
import cn.cuit.ds.domain.Goods2Orders;
import cn.cuit.ds.utils.JdbcUtils;

@Repository(value="Goods2OrdersDao")
public class Goods2OrdersDao implements IGoods2OrdersDao {

	public void add(String goodsId, String ordersId) {
		QueryRunner runner =JdbcUtils.getQueryRunner();
		String sql = "insert into goods2orders values(?,?)";
		try {
			runner.update(sql, goodsId,ordersId);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public List<String> getAllgoodsIdByOrdersId(String ordersId) {
		QueryRunner runner =JdbcUtils.getQueryRunner();
		String sql = "select * from goods2orders where ordersId =";
		return null;
	}

	public List<String> getAllOrdersIdByGoodsId(String goodsId) {
		return null;
	}


}
